Learn R Programming

Compositional (version 2.8)

Multivariate or univariate regression with compositional data in the covariates side using the alpha-transformation: Multivariate or univariate regression with compositional data in the covariates side using the \(\alpha\)-transformation

Description

Multivariate or univariate regression with compositional data in the covariates side using the \(\alpha\)-transformation.

Usage

alfa.pcr(y, x, a, k, xnew = NULL)

Arguments

y

A numerical vector containing the response variable values. They can be continuous, binary or discrete (counts).

x

A matrix with the predictor variables, the compositional data.

a

The value of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If \(\alpha=0\) the isometric log-ratio transformation is applied.

k

A number at least equal to 1. How many principal components to use.

xnew

A matrix containing the new compositional data whose response is to be predicted. If you have no new data, leave this NULL as is by default.

Value

The output of the pcr or glm.pcr depending on the type of the response.

Details

The \(\alpha\)-transformation is applied to the compositional data first and then the principal components regression is performed. The family of distributions can be either, "normal" for continuous response and hence normal distribution, "binomial" corresponding to binary response and hence logistic regression or "poisson" for count response and poisson regression.

References

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. http://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. http://arxiv.org/pdf/1106.1451.pdf

See Also

pcr, glm.pcr, alfapcr.tune

Examples

Run this code
# NOT RUN {
library(MASS)
y <- as.vector(fgl[, 1])
x <- as.matrix(fgl[, 2:9])
x <- x / rowSums(x)
mod <- alfa.pcr(y = y, x = x, 0.7, 1)
mod
# }

Run the code above in your browser using DataLab